package mytest.ssw.www.myandroidproject.tools;

import android.accounts.AbstractAccountAuthenticator;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
 * Created by 73409 on 2015/10/26.
 */
public class StreamTools {
public static  String readFromStream(InputStream is) throws IOException{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    byte[] buffe = new byte[1024];
    int len = 0;
    while ((len=is.read(buffe))!=-1)
    {
        baos.write(buffe,0,len);
    }
    is.close();
    String result = baos.toString();
    baos.close();
    return  result;
 }

}
